#define _CRT_SECURE_NO_WARNINGS 1
#include"Heap.h"

void DataCreate()
{
	int n = 100000;
	srand(time(0));
	const char* file = "nums.txt";
	FILE* fin = fopen(file, "w");
	if (fin == NULL)
	{
		perror("fin fail");
		return;
	}
	for (size_t i = 0; i < n; i++)
	{
		int x = rand() % 10000;
		fprintf(fin, "%d\n", x);
	}
	fclose(fin);
}

int main()
{
	//HP hp;
	//HeapInit(&hp);
	//HeapPush(&hp, 1);
	//HeapPush(&hp, 2);
	//HeapPush(&hp, 3);
	//HeapPush(&hp, 4);
	//HeapPush(&hp, 5);
	//HeapPush(&hp, 6);
	//HeapPush(&hp, 7);



	//int k = 0;
	//scanf("%d", &k);
	//while (!HeapEmpty(&hp) && k--)
	//{
	//	printf("%d ", HeapTop(&hp));
	//	HeapPop(&hp);
	//}
	//printf("\n");

	//DataCreate();

	int a[] = { 6,4,0,7,8,3,1,2,5,9 };
	int n = sizeof(a) / sizeof(int);
	HeapSort(a, n);
	
	for (int i = 0; i < n; i++)
	{
		printf("%d ", a[i]);
	}
	printf("\n");


	return 0;
}